Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and update Timer requirements #75

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

simhein
Copy link
Collaborator

@simhein simhein commented Jun 26, 2024

Add new Timers system requirements.
Remove user story from the system requirements.

Add new software timers requirements.
Regenerate the software requirements UIDs

Add new Timers system requirements.
Remove user story from the system requirements.
Update description and titels of the existing requirements to
fit better to the guidelines.

Signed-off-by: Simon Hein <shein@baumer.com>
@simhein simhein added the Requirements Requirements work label Jun 26, 2024
@simhein simhein requested review from nashif and a team June 26, 2024 18:28
@simhein simhein linked an issue Jun 27, 2024 that may be closed by this pull request
3 tasks
Copy link

@tobiaskaestner tobiaskaestner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments and suggestions with the proposed changes.
There are only a couple of additional things I want to mention here>

  1. The function where the application can query the next expiry time in systicks is not covered.
  2. Do we need to specify how users can influence a timer's resolution (in ns/ms/whatever) ?
  3. For the thread syncing functionality do we need to allow for more than one thread that can synchronize with a given timer?

<<<
USER_STORY: >>>
As a Zephyr RTOS user, I want to be able to track the passed real time in the OS with a dedicated hardware counter and interrupt.
The Zephyr RTOS shall provide a mechanism to define and initialize a timer at run time.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
The Zephyr RTOS shall provide a mechanism to define and initialize a timer at run time.
The Zephyr RTOS shall provide a mechanism to define and initialize timers at run time.

TITLE: Call functions in interrupt context
TITLE: Timer definition at compile time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to define and initialize a timer at compile time.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
The Zephyr RTOS shall provide a mechanism to define and initialize a timer at compile time.
The Zephyr RTOS shall provide a mechanism to define and initialize timers at compile time.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

** nitpick **:

A technically more precise term is probably static initialization

COMPONENT: Timers
TITLE: Timer status
STATEMENT: >>>
A Zephyr RTOS timer shall have a status which indicates the expiration of the timer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
A Zephyr RTOS timer shall have a status which indicates the expiration of the timer.
A Zephyr RTOS timer shall have a means to indicate whether the timer has already expired or not.

I'd consider a status field a design spec and would leave it out of the RQT

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it would speak about a status field here I would agree that it should be in the design, but in this case we only speak of a status a timer has if it is expired or not. Obviously that will most of the time end up in a design with a status filed 😄

[REQUIREMENT]
UID: ZEP-SRS-4-3
STATUS: Draft
TYPE: Non-Functional

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): Why is this non-functional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status req is non functional because in first place this isn't good testable on it's own. And more detailed use of the status is specified in follow up regs.

[REQUIREMENT]
UID: ZEP-SRS-4-4
STATUS: Draft
TYPE: Non-Functional

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why is this non-functional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simple copy paste error.

STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer remaining expiration system tick time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
TITLE: Timer remaining expiration system tick time
TITLE: Provide timer remaining expiration time in units of system ticks

STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer remaining expiration time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
TITLE: Timer remaining expiration time
TITLE: Provide timer remaining expiration time in milliseconds

COMPONENT: Timers
TITLE: Timer remaining expiration time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to get the timer remaining until expiration time in milliseconds.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
The Zephyr RTOS shall provide a mechanism to get the timer remaining until expiration time in milliseconds.
The Zephyr RTOS shall provide a mechanism to get the timer's remaining time until its next expiry in milliseconds.

Comment on lines 307 to 279
[REQUIREMENT]
UID: ZEP-SRS-4-24
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer remaining expiration time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to get the timer remaining until expiration time in milliseconds.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Is this a duplicate of ZEP-SRS-4-23?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment on lines 346 to 314
[REQUIREMENT]
UID: ZEP-SRS-4-27
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer expire functions in interrupt context
STATEMENT: >>>
When the timer expiry function is defined, it shall be called in the interrupt context.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Is this really a requirement? To me this looks like a (natural) design rationale. This might not even be true for all architectures, ie. those that don't have a systick interrupt context like native_sim?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion this is a requirement because if this wouldn't be here wouldn't the timer behave different on different architectures?
And do we really need to consider native sim, I don't think so because it is a simulation of a system and that usual behaves often different than a real architecture.

@simhein simhein force-pushed the timers_req branch 2 times, most recently from 7861f70 to bffab9a Compare July 9, 2024 15:13
Add new timers requirements on the software level
Remove the user stories from the existing requirements.
Remove obsolete requirements and rephrase existing ones.

Signed-off-by: Simon Hein <shein@baumer.com>
@simhein
Copy link
Collaborator Author

simhein commented Jul 9, 2024

I left a couple of comments and suggestions with the proposed changes. There are only a couple of additional things I want to mention here>

1. The function where the application can query the next expiry time in systicks is not covered.

Added.

2. Do we need to specify how users can influence a timer's resolution (in ns/ms/whatever) ?

I think that could be specified but i don't see it here for the feature timer. because it don't give options to influence a timers resolution.

3. For the thread syncing functionality do we need to allow for more than one thread that can synchronize with a given timer?

Yes that is the way it is implemented as far as I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Requirements Requirements work
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Timers Requirements
2 participants